﻿using System.Threading.Tasks;

namespace Material.Mvc.Services
{
    public interface ICustomerService
    {
        /// <summary>
        /// 处理用户消息并返回客服回复
        /// </summary>
        /// <param name="userId">用户ID，用于维护对话上下文</param>
        /// <param name="message">用户消息</param>
        /// <returns>客服回复</returns>
        Task<string> ProcessMessageAsync(string userId, string message);

        /// <summary>
        /// 清除用户的对话历史
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>是否成功</returns>
        Task<bool> ClearHistoryAsync(string userId);

        /// <summary>
        /// 初始化知识库
        /// </summary>
        /// <returns>是否成功</returns>
        Task<bool> InitializeKnowledgeBaseAsync();
        
        /// <summary>
        /// 测试OpenAI API连接是否正常
        /// </summary>
        /// <returns>连接状态信息</returns>
        Task<string> TestConnectionAsync();
    }
}
